home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 3.iso / dist / fw_expect.idb / usr / freeware / bin / ftp-rfc.z / ftp-rfc
Text File  |  1999-01-26  |  582b  |  35 lines

  1. #!/usr/freeware/bin/expect --
  2.  
  3. # ftp-rfc <rfc-number>
  4. # ftp-rfc -index
  5.  
  6. # retrieves an rfc (or the index) from uunet
  7.  
  8. exp_version -exit 5.0
  9.  
  10. if $argc!=1 {
  11.     send_user "usage: ftp-rfc \[#] \[-index]\n"
  12.     exit
  13. }
  14.  
  15. set file "rfc$argv.Z"
  16.  
  17. set timeout 60
  18. spawn ftp ftp.uu.net
  19. expect "Name*:"
  20. send "anonymous\r"
  21. expect "Password:"
  22. send "expect@nist.gov\r"
  23. expect "ftp>"
  24. send "binary\r"
  25. expect "ftp>"
  26. send "cd inet/rfc\r"
  27. expect "550*ftp>" exit "250*ftp>"
  28. send "get $file\r"
  29. expect "550*ftp>" exit "200*226*ftp>"
  30. close
  31. wait
  32. send_user "\nuncompressing file - wait...\n"
  33. exec uncompress $file
  34.  
  35.